<template>
	<!-- 首页轮播 -->
	<van-swipe :autoplay="3000">
		<van-swipe-item v-for="(item,i) in carouselItems" :key="i" @click="onDetail(item.product_id)">
			<van-image :src="APIDomainName + item.img" width="100%"/>
		</van-swipe-item>
	</van-swipe>
</template>

<script>
	export default {
		name: 'homeSwipe',
		props: {
			carouselItems: Array,
		},

		methods: {
			onDetail(id) {
				this.$router.push(`/product/detail/${id}`);
			}
		}
	}
</script>
<style scoped>
</style>
